<template>
  <div class="line-echart">
    <BaseEcharts :options="options"></BaseEcharts>
  </div>
</template>

<script lang="ts">
import { reactive, toRefs, ref, computed } from "vue";
import { useStore } from "vuex";
import { defineComponent } from "vue";
import BaseEcharts from "@/base-ui/echarts";
import { IDataType } from "../types";
export default defineComponent({
  components: {
    BaseEcharts
  },
  // props: {
  //   pieData: IDataType[],
  //  x的值 xLabels
  //  y的值 value data: [120, 132, 101, 134, 90, 230, 210]
  // },
  setup(props) {
    components: {
      BaseEcharts;
    }
    const store = useStore();
    const options = {
      tooltip: {
        trigger: "axis"
      },
      legend: {
        data: ["塑料", "衣物", "家电", "玩具", "课本"]
      },
      grid: {
        left: "3%",
        right: "4%",
        bottom: "3%",
        containLabel: true
      },
      toolbox: {},
      xAxis: {
        type: "category",
        boundaryGap: false,
        data: [
          "一月份",
          "三月份",
          "五月份",
          "七月份",
          "九月份",
          "十一月份",
          "十二月份"
        ]
      },
      yAxis: {
        type: "value"
      },
      series: [
        {
          name: "塑料",
          type: "line",
          stack: "Total",
          data: [120, 132, 101, 134, 90, 230, 210]
        },
        {
          name: "衣物",
          type: "line",
          stack: "Total",
          data: [220, 182, 191, 234, 290, 330, 310]
        },
        {
          name: "家电",
          type: "line",
          stack: "Total",
          data: [150, 232, 201, 154, 190, 330, 410]
        },
        {
          name: "玩具",
          type: "line",
          stack: "Total",
          data: [320, 332, 301, 334, 390, 330, 320]
        },
        {
          name: "课本",
          type: "line",
          stack: "Total",
          data: [820, 932, 901, 934, 1290, 1330, 1320]
        }
      ]
    };
    return {
      options
    };
  }
});
</script>
<style scoped lang="less"></style>
